(deftemplate Animal
    (slot nume)
    (slot hrana)
    (slot hranaConsumata)
    (slot modViata)
    (slot mediuViata)
    (slot zonaProvenienta)
    (slot reproducere)
    )
(assert (Animal(nume lup)(hrana carnivor)(hranaConsumata oaie)(modViata diurn)(mediuViata terestru)(zonaProvenienta alpina)(reproducere pui-vii)))
(assert (Animal(nume liliac)(hrana insectivor)(hranaConsumata musca)(modViata nocturn)(mediuViata aerian)(zonaProvenienta temperata)(reproducere pui-vii)))
(assert (Animal(nume gaina)(hrana vegetarian)(hranaConsumata iarba)(modViata diurn)(mediuViata terestru)(zonaProvenienta temperata)(reproducere oua)))
(assert (Animal(nume delfin)(hrana carnivor)(hranaConsumata peste)(modViata diurn)(mediuViata acvatic)(zonaProvenienta mediteraneana)(reproducere pui-vii)))
(assert (Animal(nume vaca)(hrana vegetarian)(hranaConsumata iarba)(modViata diurn)(mediuViata terestru)(zonaProvenienta temperata)(reproducere pui-vii)))
(assert (Animal(nume pisica)(hrana carnivor)(hranaConsumata tocana)(modViata diurn)(mediuViata terestru)(zonaProvenienta temperata)(reproducere pui-vii)))
(assert(Animal(nume broasca)(hrana omnivor)(hranaConsumata chestii)(modViata diurn)(mediuViata semiacvatic)(zonaProvenienta mediteraneana)(reproducere oua)))
(assert(Animal(nume rata)(hrana vegetarian)(hranaConsumata iarba)(modViata diurn)(mediuViata semiacvatic)(zonaProvenienta temperata)(reproducere oua)))
(assert(Animal(nume zebra)(hrana vegetarian)(hranaConsumata iarba)(modViata diurn)(mediuViata terestru)(zonaProvenienta mediteraneana)(reproducere pui-vii)))
(assert(Animal(nume urs)(hrana omnivor)(hranaConsumata peste)(modViata diurn)(mediuViata terestru)(zonaProvenienta polara)(reproducere pui-vii)))
(assert(Animal(nume foca)(hrana carnivor)(hranaConsumata peste)(modViata diurn)(mediuViata semiacvatic)(zonaProvenienta polara)(reproducere pui-vii)))
(facts)
(run)

(defrule reg1
    (Animal (nume ?n))
    (Animal(nume ?n)(mediuViata semiacvatic))
=>
	(printout t "Animalul " ?n " are mediul de viata semiacvatic." crlf)
    )

(run)

(printout t "-----------------------------------------------------------------" crlf)

(defrule reg2
    (Animal (nume ?n))
    (Animal(nume ?n)(hrana vegetarian)(zonaProvenienta mediteraneana))
=>
	(printout t "Animalul " ?n " este vegetarian si provine din zona mediterana." crlf)
    )

(run)

(printout t "-----------------------------------------------------------------" crlf)

(defrule reg3
    (Animal (nume ?n)(hranaConsumata ?h))
 
=>
	(printout t "( animal consumator = " ?n " , hrana consumata = " ?h " )" crlf)
    )

(run)

(printout t "-----------------------------------------------------------------" crlf)




